#!/bin/bash
#
# Retail (non-debug) build script
#

# =======================================================
# prebuild.sh usage:
#     
#     $1 = Sourceroot (where src is)
#     $2 = title (retail debug, or both)
#     $3 = buildnumber (title.version+p4 change)
#     $4 = Perforce Client/CVS port spec 
# =======================================================

export SourceRoot=$1
export BuildTitle=$2
export BuildNumber=$3
export SourceClient=$4

#
# This example is for a Java job, just alter to suit the job
#
export JAVA_HOME=/usr/j2sdk1.4.1_02
export ANT_HOME=/usr/local/apache-ant-1.6.1
export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:/usr/local/bin:$PATH

cd $SourceRoot

#
#  If the build fails, return 1 so the build server knows it's failed
#
ant || exit 1

#
# Any non 0 exit code will result in the reporting of a build failure
#
exit 0
